﻿<%@ Page Language="C#" MasterPageFile="~/admins/AdminMaster.Master" AutoEventWireup="True"
    CodeFile="GroupNews.aspx.cs" Inherits="MyWeb.Admin.GroupNews" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <div class="PageName"> Quản lý nhóm tin</div>
  <asp:Label ID=lb_messenger runat=server></asp:Label>
  <asp:Panel ID="pnView" runat="server">
    <div id="search_block"> Nhóm tin:
      <asp:DropDownList ID="drop_loai_tin" runat="server" AutoPostBack=true> </asp:DropDownList>
    </div>
    <div class="Control">
      <ul>
        <li>
          <asp:LinkButton CssClass="vadd" ID="lbtAddT" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton>
        </li>
        <li>
          <asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" OnClick="DeleteButton_Click">Xóa</asp:LinkButton>
        </li>
         <li>
                    <asp:LinkButton CssClass="uupdate" ID="lbtUpdateOrd" runat="server" OnClick="lbtUpdateOrd_Click">Cập nhật thứ tự</asp:LinkButton>
                </li>
        <li>
          <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton>
        </li>
        <li><a class="vback" href="javascript:void(0);" onClick="window.history.go(-1);">Trở
          lại</a> </li>
      </ul>
    </div>
    <asp:DataGrid ID="grid_tin" runat="server" Width="100%" CssClass="TableView"
            AutoGenerateColumns="False" AllowPaging="False">
      <HeaderStyle CssClass="trHeader"></HeaderStyle>
      <ItemStyle CssClass="trOdd"></ItemStyle>
      <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
      <Columns>
      <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
        <HeaderTemplate>
          <asp:CheckBox ID="chkSelectAll" onClick="check_all(this);" runat="server" AutoPostBack="False"></asp:CheckBox>
        </HeaderTemplate>
        <ItemTemplate>
          <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
        </ItemTemplate>
        <ItemStyle CssClass="tdCenter"></ItemStyle>
      </asp:TemplateColumn>
      <asp:BoundColumn DataField="loai_tin_id" HeaderText="Id" Visible="False" />
      <asp:BoundColumn DataField="tin_cha_id" HeaderText="Active" Visible="False" />
      <asp:BoundColumn DataField="anh_to" HeaderText="Active" Visible="False" />
      <asp:BoundColumn DataField="anh_nho" HeaderText="Active" Visible="False" />
      <asp:BoundColumn DataField="tin_id" HeaderText="Active" Visible="False" />
      <asp:TemplateColumn ItemStyle-CssClass="Text">
        <HeaderTemplate> Tiêu đề</HeaderTemplate>
        <ItemTemplate>
          <asp:Label ID="Label1" runat="server" Text='<%# Eval("tieu_de")%>'></asp:Label>
        </ItemTemplate>
      </asp:TemplateColumn>
       <asp:TemplateColumn ItemStyle-CssClass="Activehead">
                    <HeaderTemplate>
                        Thứ tự
                        <asp:LinkButton CssClass="sortasc" ID="lbtascord" CommandName="ascord" runat="server"
                            ToolTip="Sắp xếp theo thứ tự tăng dần">s</asp:LinkButton>
                        <asp:LinkButton CssClass="sortdesc" ID="lbtdescord" CommandName="descord" runat="server"
                            ToolTip="Sắp xếp theo thứ tự giảm dần">s</asp:LinkButton>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:TextBox ID="txtOrd" runat="server" Text='<%# Eval("vi_tri")%>' CssClass="text number"
                            Width="80px" Style="text-align: center"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvOrdview" runat="server" ControlToValidate="txtOrd"
                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                    <ItemStyle CssClass="Activehead" />
                </asp:TemplateColumn>
      <%-- <asp:TemplateColumn ItemStyle-CssClass="CheckBox">
                    <HeaderTemplate>
                        Kích hoạt</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblStatus" runat="server" Text='<%%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>--%>
      <asp:TemplateColumn ItemStyle-CssClass="Function">
        <HeaderTemplate> Chức năng</HeaderTemplate>
        <ItemTemplate>
         <%-- <asp:ImageButton ID="cmdAddSub" runat="server" AlternateText="Thêm cấp con" CommandName="AddSub"
                            CssClass="Add" ToolTip="Thêm cấp con" ImageUrl="/App_Themes/Admin/images/add.png"
                            CommandArgument='<%%>' />--%>
          <asp:ImageButton
                                ID="cmdEdit" runat="server" AlternateText="Sửa" CommandName="Edit" CssClass="Edit"
                                ToolTip="Sửa" ImageUrl="/App_Themes/Admin/images/edit.png" CommandArgument='<%# Eval("tin_id")%>' />
          <asp:ImageButton
                                    ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete" CssClass="Delete"
                                    ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png" CommandArgument='<%# Eval("tin_id")%>'
                                    OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" />
         <%-- <asp:ImageButton
                                        ID="cmdActive" runat="server" AlternateText='<%%>'
                                        CommandName="Active" CssClass="Active" ToolTip='<%%>'
                                        ImageUrl='<%%>'
                                        CommandArgument='<%%>' />--%>
        </ItemTemplate>
      </asp:TemplateColumn>
      </Columns>
    </asp:DataGrid>
    <div class="Control">
      <ul>
        <li>
          <asp:LinkButton CssClass="vadd" ID="lbtAddB" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton>
        </li>

        <li>
          <asp:LinkButton CssClass="vdelete" ID="lbtDeleteB" runat="server" OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" OnClick="DeleteButton_Click">Xóa</asp:LinkButton>
        </li>
         <li>
                    <asp:LinkButton CssClass="uupdate" ID="LinkButton1" runat="server" OnClick="lbtUpdateOrd_Click">Cập nhật thứ tự</asp:LinkButton>
                </li>
        <li>
          <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshB" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton>
        </li>
        <li><a class="vback" href="javascript:void(0);" onClick="window.history.go(-1);">Trở
          lại</a> </li>
      </ul>
    </div>
    </asp:Panel>
  <asp:Panel ID="pnUpdate" runat="server" Visible="False">
    <table class="TableUpdate" border="1">
      <tr>
        <td class="Control" colspan="2"><ul>
            <li>
              <asp:LinkButton CssClass="uupdate" ID="lbtUpdateT" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton>
            </li>
            <li>
              <asp:LinkButton CssClass="uback" ID="lbtBackT" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton>
            </li>
          </ul></td>
      </tr>
      <tr>
        <th> <asp:Label ID="lblName" runat="server" Text="Loại tin:"></asp:Label>
        </th>
        <td><asp:DropDownList ID=drop_lt runat=server AutoPostBack=true></asp:DropDownList>
        </td>
      </tr>
      <div id=div_menu_ngang runat=server>
        <tr>
          <th> <asp:Label ID="Label2" runat="server" Text="Tin cha:"></asp:Label>
          </th>
          <td><asp:DropDownList ID=drop_tin_cha runat=server></asp:DropDownList>
          </td>
        </tr>
      </div>
      <tr>
        <th> <asp:Label ID="lblTitle" runat="server" Text="Url:"></asp:Label>
        </th>
        <td><asp:TextBox ID="txt_url" runat="server" CssClass="text"></asp:TextBox>
        </td>
      </tr>
      <tr>
        <th> <asp:Label ID="Label4" runat="server" Text="Tiêu đề:"></asp:Label>
        </th>
        <td><asp:TextBox ID="txt_tieu_de" runat="server" CssClass="text"></asp:TextBox>
        </td>
      </tr>
      <tr>
        <th> <asp:Label ID="Label5" runat="server" Text="Mô tả ngắn:"></asp:Label>
        </th>
        <td><CKEditor:CKEditorControl ID="cke_mo_ta_ngan" runat="server"></CKEditor:CKEditorControl>
        </td>
      </tr>
      <tr>
        <th> <asp:Label ID="Label6" runat="server" Text="Nội dung:"></asp:Label>
        </th>
        <td><CKEditor:CKEditorControl ID="cke_noi_dung" runat="server"></CKEditor:CKEditorControl>
        </td>
      </tr>
      <tr>
        <th> <asp:Label ID="Label7" runat="server" Text="Ảnh nhỏ:"></asp:Label>
        </th>
        <td><asp:FileUpload ID=file_anh_nho runat=server />
        </td>
      </tr>
      <%--<tr>
        <th> <asp:Label ID="Label8" runat="server" Text="Ảnh to:"></asp:Label>
        </th>
        <td><asp:FileUpload ID=file_anh_to runat=server />
        </td>
      </tr>--%>
      <tr>
        <th> <asp:Label ID="lblOrd" runat="server" Text="Thứ tự:"></asp:Label>
        </th>
        <td><asp:TextBox ID="txt_vi_tri" runat="server" CssClass="text number" Text=1 />
          <asp:RequiredFieldValidator
                        ID="rfvOrd" runat="server" ControlToValidate="txt_vi_tri" Display="Dynamic" ErrorMessage="*"
                        SetFocusOnError="True"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr>
        <td class="Control" colspan="2"><ul>
            <li>
              <asp:LinkButton CssClass="uupdate" ID="lbtUpdateB" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton>
            </li>
            <li>
              <asp:LinkButton CssClass="uback" ID="lbtBackB" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton>
            </li>
          </ul></td>
      </tr>
    </table>
    </asp:Panel>
</asp:Content>
